<form class="layui-form" method="post">
    <div class="layui-form-item" style="padding-top: 2%">
        <label class="layui-form-label">名称：</label>
        <div class="layui-input-inline">
            <if condition="$date['id'] neq null">
                <span style="display: block;  padding: 9px 0px;">{$date['ser_name']}</span>
            </if>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">地域：</label>
        <div class="layui-input-block">
            <span style="display: block;  padding: 9px 0px;">{$date['package_remark']['regionsname']}</span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">机房地址：</label>
        <div class="layui-input-block">
            <span style="display: block;  padding: 9px 0px;">{$date['package_remark']['zonename']}</span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">主机型号：</label>
        <div class="layui-input-block">
            <span style="display: block;  padding: 9px 0px;">{$date['package_remark']['describeTypes']}</span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">CPU/内存：</label>
        <div class="layui-input-block" id="hostcpu">
           <span style="display: block;  padding: 9px 0px;">{$date['package_remark']['hostcpu']}核/{$date['package_remark']['sdk']}</span>
        </div>
    </div>
   <!-- <div class="layui-form-item">
        <label class="layui-form-label">价格/时：</label>
        <div class="layui-input-block">
            <input type="text" name="taocanprice" lay-verify="price" value="{$date.price}" placeholder="保留两位小数" class="layui-input layui-input80">
        </div>
    </div>-->
   <!-- <div class="layui-form-item">
        <label class="layui-form-label">磁盘大小：</label>
        <div class="layui-input-block">
            <span style="display: block;  padding: 9px 0px;">{$date.package_remark.diskzero}GB</span>
        </div>
    </div>-->
    <if condition="$date['id'] neq null">
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" <if condition="$date['status'] eq 1">checked</if> lay-text="开启|禁止" lay-skin="switch">
            </div>
        </div>
    </if>
    <!--<div class="layui-form-item">
        <label class="layui-form-label">磁盘类型：</label>
        <div class="layui-input-block">
            <select name="disktype" lay-verify="required"  lay-filter="disktype">
                <option value=""></option>
                <option value="ssd"  <if condition="$date['package_remark']['disktype'] eq 'ssd'">selected</if>>SSD硬盘</option>
                <option value="ebs" <if condition="$date['package_remark']['disktype'] eq 'ebs'">selected</if>>云硬盘</option>
            </select>
        </div>
    </div>-->
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="sitesub">提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script id="imgtpl" type="text/html">
    <option value="{{d.id}}">{{d.name}}</option>
</script>
<script>
    form.render();
    var imglist={};
    var hostlist={};
    var sdk=[1,2,4,6,8,12,16,24,32];

    form.verify({
        price: [
            /^\d+(\.\d{1,2})?$/
            ,'整数或者带两位小数'
        ],
    });

    form.on('submit(sitesub)', function(data){
        var userInfo = data.field;
        var url = "__SELF__";
        $.post(url,userInfo,function(data){
            if(data.code == '4001'){
                layer.msg(data.msg,{icon: 5});
                return;
            }else if(data.code == '101'){
                layer.msg(data.msg, {
                    icon: 6,
                    time: 2000
                }, function(){
                    location.reload();
                });
            }else{
                layer.msg("数据错误",{icon: 5});
                return;
            }
        });

        return false;
    });



</script>